<?php
	$con = mysql_connect("localhost:3306","root","shibani");
	if (!$con)
	{
		die('Could not connect: ' . mysql_error());
	}

	mysql_select_db("cal2sync", $con);

	$id = mysql_query("SELECT u_id FROM user WHERE username = '".$_POST['username']."'");
	while($row = mysql_fetch_array($id))
	{
		$uid = $row['u_id'];
	}
	
	$result = mysql_query("SELECT action FROM rules WHERE event_type = '".$_POST['event_type']."'AND u_id = '".$uid."'");
	while($row=mysql_fetch_array($result))
	{
		$action = $row['action'];
	}
	
	mysql_close($con);
	//return $result;

	echo $action;
?>